﻿[{
    "name": "Media Capture",
    "desc": "Capture an image and save it to disk",
    "source": function () {
        Windows.Storage.DownloadsFolder.createFileAsync("user.bmp").then(function (file) {
            var mediaCapture = new Windows.Media.Capture.MediaCapture();
            var imageEncodingProperties = new Windows.Media.Capture.ImageEncodingProperties();
            mediaCapture.capturePhotoToStorageFileAsync(imageEncodingProperties, file).then(function () {
                console.log("Done");
            }, function () {
                console.log("Error");
            });
        }, function () {
            console.log("Error saving")
        });
    }
},
{
    "name": "Audio Device Controller",
    "desc": "Controls device settings on the microphone.",
    "source": function () {
        var mediaCapture = new Windows.Media.Capture.MediaCapture();
        var audioDeviceController = mediaCapture.audioDeviceController;
        console.log("Muted ? " + audioDeviceController.muted);
        console.log("Volume Percentage " + audioDeviceController.volumePercent);
    }
},
{
    "name": "Video Device Controller",
    "desc": "Gets the capabilities of a camera setting.",
    "source": function () {
        var mediaCapture = new Windows.Media.Capture.MediaCapture();
        var videoDeviceController = mediaCapture.videoDeviceController;
        console.log("Back-light compensation on the camera " + videoDeviceController.backlightCompensation);
        console.log("brightness level " + videoDeviceController.brightness);
        console.log("contrast level on the camera " + videoDeviceController.contrast);
        console.log("Exposure time " + videoDeviceController.exposure);
        console.log("Focus setting " + videoDeviceController.focus);
        console.log("Hue setting " + videoDeviceController.hue);
        console.log("Pan setting " + videoDeviceController.pan);
        console.log("Roll setting " + videoDeviceController.roll);
        console.log("Tilt setting " + videoDeviceController.tilt);
    }
},
{
    "name": "Audio Device Controller",
    "desc": "Controls device settings on the microphone.",
    "source": function () {

    }
},
]